#!/bin/bash

gcc -pipe -O3 -march=core2 -mfpmath=sse -msse4.1 -pthread -Wl,-s,-O1 -lm -o $1 $1.c
# echo "0"
# time ./first < in0 > /tmp/ref0
# time ./$1 < in0 > /tmp/out0
# cmp /tmp/out0 /tmp/ref0
echo "1-----------------------------------------------------------------------"
# time ./first < in1 > /tmp/ref1
time ./$1 < in1 > /tmp/out1
cmp /tmp/out1 /tmp/ref1
echo "2-----------------------------------------------------------------------"
# time ./first < in2 > /tmp/ref2
time  ./$1 < in2 > /tmp/out2
cmp /tmp/out2 /tmp/ref2
